package com.wy.system.service.impl;

import java.util.List;

import com.wy.system.domain.SysCarport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import com.wy.system.mapper.CarportViewMapper;
import com.wy.system.domain.CarportView;
import com.wy.system.service.ICarportViewService;

/**
 * VIEWService业务层处理
 * 
 * @author ruoyi
 * @date 2023-05-16
 */
@Service
@Primary
public class CarportViewServiceImpl implements ICarportViewService 
{
    @Autowired
    private CarportViewMapper carportViewMapper;

    /**
     * 查询VIEW
     * 
     * @param id VIEW主键
     * @return VIEW
     */
    @Override
    public CarportView selectCarportViewById(Long id)
    {
        return carportViewMapper.selectCarportViewById(id);
    }

    /**
     * 查询VIEW列表
     * 
     * @param carportView VIEW
     * @return VIEW
     */
    @Override
    public List<CarportView> selectCarportViewList(CarportView carportView)
    {
        return carportViewMapper.selectCarportViewList(carportView);
    }

    /**
     * 新增VIEW
     * 
     * @param carportView VIEW
     * @return 结果
     */
    @Override
    public int insertCarportView(SysCarport carportView)
    {
//        SysCarport carport=new SysCarport();
//        carport.setAddress(carportView.getAddress());
//        carport.setcId(carportView.getcId());
//        carport.setStatus(carportView.getStatus());
//        carport.setType(carportView.getType());

        return carportViewMapper.insertCarportView(carportView);
    }

    /**
     * 修改VIEW
     * 
     * @param carportView VIEW
     * @return 结果
     */
    @Override
    public int updateCarportView(CarportView carportView)
    {
//            <if test="address != null">address = #{address},</if>
//            <if test="cId != null">c_id = #{cId},</if>
//            <if test="status != null">status = #{status},</if>
//            <if test="type != null">type = #{type},</if>

//            <if test="user != null">user = #{user},</if>

        return carportViewMapper.updateCarportView(carportView);
    }

    /**
     * 批量删除VIEW
     * 
     * @param ids 需要删除的VIEW主键
     * @return 结果
     */
    @Override
    public int deleteCarportViewByIds(Long[] ids)
    {
        return carportViewMapper.deleteCarportViewByIds(ids);
    }

    /**
     * 删除VIEW信息
     * 
     * @param id VIEW主键
     * @return 结果
     */
    @Override
    public int deleteCarportViewById(Long id)
    {
        return carportViewMapper.deleteCarportViewById(id);
    }
}
